package net.goutalk.glcs.module.erpModel.caseErpStock.controller;

import net.goutalk.glcs.common.model.result.R;
import net.goutalk.glcs.module.erpModel.caseErpStock.service.ICaseErpInstoreLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 入库记录【case_erp_instore_log】 前端控制器
 * </p>
 *
 * @author hnyyzy
 * @since 2023-06-20
 */
@RestController
@AllArgsConstructor
@RequestMapping("/caseErpStock/caseErpInstoreLog")
@Api(value = "ERP报表",tags = "ERP报表")
public class CaseErpInstoreLogController {

    private ICaseErpInstoreLogService caseErpInstoreLogService;

    @GetMapping("/statistical-data")
    @ApiOperation("统计数据")
    public R statisticalData(){
        return R.ok(caseErpInstoreLogService.getStatisticalData());
    }

    @GetMapping("/doc-analysis")
    @ApiOperation("月出库单分析")
    public R docAnalysis(){
        return R.ok(caseErpInstoreLogService.getDocAnalysis());
    }

    @GetMapping("/doc-analysis-out")
    @ApiOperation("月出库单分析")
    public R docAnalysisOut(){
        return R.ok(caseErpInstoreLogService.getDocAnalysisOut());
    }

    @GetMapping("/trend")
    @ApiOperation("进库趋势")
    public R trend(){
        return R.ok(caseErpInstoreLogService.trend());
    }


    @GetMapping("/trend-out")
    @ApiOperation("出库趋势")
    public R trendOut(){
        return R.ok(caseErpInstoreLogService.trendOut());
    }

    @GetMapping("/warn")
    @ApiOperation("预警类型占比")
    public R warn(){
        return R.ok(caseErpInstoreLogService.warn());
    }
    @GetMapping("/materials")
    @ApiOperation("在库原材料占比")
    public R materials(){
        return R.ok(caseErpInstoreLogService.materials());
    }


    @GetMapping("/purchase-data")
    @ApiOperation("采购报表统计数据")
    public R purchaseData(){
        return R.ok(caseErpInstoreLogService.getPurchaseDataData());
    }
    @GetMapping("/cost-analysis-data")
    @ApiOperation("采购成本分析(金额)")
    public R costAnalysis(){
        return R.ok(caseErpInstoreLogService.getCostAnalysis());
    }

    @GetMapping("/contract-management")
    @ApiOperation("采购合同管理")
    public R contractManagement(){
        return R.ok(caseErpInstoreLogService.getContractManagement());
    }


    @GetMapping("/deviation-analysis")
    @ApiOperation("本年采购价格偏差分析")
    public R  deviationAnalysis(){
        return R.ok(caseErpInstoreLogService.getDeviationAnalysis());
    }

    @GetMapping("/supply-trends")
    @ApiOperation("供应链趋势")
    public R  supplyTrends(){
        return R.ok(caseErpInstoreLogService.getSupplyTrends());
    }

    @GetMapping("/purchase-price")
    @ApiOperation("原材料采购价格环比")
    public R  purchasePrice(){
        return R.ok(caseErpInstoreLogService.getPurchasePrice());
    }

    @GetMapping("/contract-types")
    @ApiOperation("采购合同类型占比")
    public R  contractTypes(){
        return R.ok(caseErpInstoreLogService.getContractTypes());
    }


    @GetMapping("/sales-statistics")
    @ApiOperation("销售报表统计数据")
    public R  salesStatistics(){
        return R.ok(caseErpInstoreLogService.getSalesStatistics());
    }

    @GetMapping("/proportion-sale")
    @ApiOperation("销售报表统计数据")
    public R  proportionSale(){
        return R.ok(caseErpInstoreLogService.getProportionSale());
    }


    @GetMapping("/proportion-income")
    @ApiOperation("本月收入占比")
    public R  proportionIncome(){
        return R.ok(caseErpInstoreLogService.getProportionIncome());
    }


    @GetMapping("/product-analysis")
    @ApiOperation("出库产品分析")
    public R  productAnalysis(){
        return R.ok(caseErpInstoreLogService.getProductAnalysis());
    }


    @GetMapping("/sale-analysis")
    @ApiOperation("销售分析")
    public R  SalesAnalysis(){
        return R.ok(caseErpInstoreLogService.getSalesAnalysis());
    }


    @GetMapping("/profit-analysis")
    @ApiOperation("本年利润偏差分析")
    public R  profitAnalysis(){
        return R.ok(caseErpInstoreLogService.getProfitAnalysis());
    }

}
